<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>餐饮预定</title>
    <link rel="stylesheet" href="${ctx}/static/merchant/css/style.css?_=${.now?string('yyyy-MM-dd')}">
    <link rel="stylesheet" href="${ctx}/static/merchant/css/visualize.css?_=${.now?string('yyyy-MM-dd')}">
    <link rel="stylesheet" href="${ctx}/static/merchant/css/date_input.css?_=${.now?string('yyyy-MM-dd')}">
    <link rel="stylesheet" href="${ctx}/static/merchant/css/jquery.alerts.css?_=${.now?string('yyyy-MM-dd')}">

    <!--[if lt IE 8]>
    <link rel="stylesheet" href="${ctx}/static/merchant/css/ie.css?_=${.now?string('yyyy-MM-dd')}">
    <![endif]-->

</head>
<body>
<div id="hld">

    <div class="wrapper">        <!-- wrapper begins -->


        <div id="header">
            <div class="hdrl"></div>
            <div class="hdrr"></div>

            <h1><a href="#">商户系统</a></h1>

            <ul id="nav">
                <li class="active"><a href="#">我的工作台</a></li>

            </ul>

            <p class="user">你好, <a href="#">${login_usr.name!}</a> | <a href="${ctx}/merchant/logout">注销</a></p>
        </div>

        <div class="block">

            <div class="block_head">
                <div class="bheadl"></div>
                <div class="bheadr"></div>

                <h2>餐饮预定</h2>

            <#--<ul>-->
            <#--<li><a href="#">Edit pages</a></li>-->
            <#--<li><a href="#">Add page</a></li>-->
            <#--</ul>-->
            </div>


            <div class="block_content">

                <form action="" method="get">
                    <p>
                        <label for="start_date">开始日期:</label>
                        <input type="text" class="text date_picker" name="start_date" id="start_date" value="${start_date!}"/>
                        <label for="start_date">结束日期:</label>
                        <input type="text" class="text date_picker" name="end_date" id="end_date" value="${end_date!}"/>
                        &nbsp;&nbsp;
                        <label for="sms_code">验证码：</label>
                        <input type="text" style="width: 160px;" class="text small" name="code" id="sms_code" value="${code!}"/>
                        &nbsp;&nbsp;
                        <label for="phone">手机号码查询：</label>
                        <input type="text" style="width: 160px;" class="text small" name="phone" id="phone" value="${phone!}"/>

                        <input type="submit" class="submit small" value="查询"/>
                    </p>
                </form>

                <table cellpadding="0" cellspacing="0" width="100%" class="sortable">

                    <thead>
                    <tr>
                        <th width="100px">预定日期</th>
                        <th width="80px">姓名</th>
                        <th width="90px">手机号码</th>
                        <td width="140px">预定项目</td>
                        <td width="60px">就餐人数</td>
                        <td width="60px">桌位类型</td>
                        <td width="60px">验证码</td>
                        <td width="60px">状态</td>
                        <td width="160px">到店时间</td>
                        <td width="70px">操作</td>
                    </tr>
                    </thead>

                    <tbody>
                        <#if bookings?? && bookings?size gt 0>
                            <#list bookings as bok>
                            <tr>
                                <td>${bok.booking_date?string("yyyy-MM-dd")}</td>
                                <td>${bok.name!}</td>
                                <td>${bok.phone!}</td>
                                <td>
                                ${bok.bname!}-<#if bok.category?? && bok.category==1>午市<#else>晚市</#if>
                                </td>
                                <td>${bok.meal_num!}</td>
                                <td>${bok.cname!}</td>
                                <td>${bok.voucher!}</td>
                                <td id="status_${bok.id!}">
                                    <#if bok.status == 1>预定成功<#elseif bok.status == 2>已到店<#elseif bok.status==-1>已过期</#if>
                                </td>
                                <td id="date_${bok.id!}">
                                    <#if bok.use_time??>
                                        ${bok.use_time?string("yyyy-MM-dd HH:mm:ss")}
                                    </#if>
                                </td>
                                <td>
                                    <#if bok.status == 1>
                                        <a href="${ctx}/merchant/repast/ok/${bok.id!}" data-target="#status_${bok.id!}" data-date="#date_${bok.id!}" class="ok_btn">到店确认</a>
                                    </#if>
                                </td>
                            </tr>
                            </#list>
                        <#else>
                        <tr>
                            <td colspan="10">
                                <div class="message warning"><p>${start_date!} <#if start_date?? && end_date??><#if start_date!=end_date>至${end_date!}</#if></#if> 还没有餐饮预定信息</p></div>
                            </td>
                        </tr>
                        </#if>
                    </tbody>

                </table>

                <div class="tableactions">
                    每页显示 <strong>${recordPage.pageSize}</strong> 条记录，共 <strong>${recordPage.totalRow}</strong> 条记录，共 <strong>${recordPage.totalPage}</strong> 页
                </div>

                <div class="pagination right">
                    <#if total gt 0>
                        <#if page gt 1>
                            <a href="${ctx}/merchant/repast?page=${page-1}&code=${code!}&phone=${phone!}&date=${date!}">&laquo;</a>
                        </#if>
                        <#list 1..total as p>
                            <a href="${ctx}/merchant/repast?page=${p}&code=${code!}&phone=${phone!}&date=${date!}"
                               <#if p == page>class="active"</#if>>${p}</a>
                        </#list>
                        <#if page lt total>
                            <a href="${ctx}/merchant/repast?page=${page+1}&code=${code!}&phone=${phone!}&date=${date!}">&raquo;</a>
                        </#if>
                    </#if>
                </div>


            </div>

            <div class="bendl"></div>
            <div class="bendr"></div>
        </div>


        <div id="footer">

            <p class="left">xxxx</p>

            <p class="right">powered by ifoly</p>

        </div>

    </div>

</div>

<!--[if IE]>
<script type="text/javascript" src="${ctx}/static/merchant/js/excanvas.js"></script>
<![endif]-->
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.img.preload.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.date_input.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.visualize.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.visualize.tooltip.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.pngfix.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/jquery.alerts.js"></script>
<script type="text/javascript" src="${ctx}/static/merchant/js/custom.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.ok_btn').click(function () {
            var $this = $(this);
            var url = $this.attr('href');
            var target = $this.attr('data-target');
            var dateEl = $this.attr('data-date');
            jConfirm('您确认改会员到店了么?', '温馨提示', function (r) {
                if (r) {
                    $.post(url, function (rst) {
                        if (rst.status == 'OK') {
                            $(target).html('已到店');
                            $(dateEl).html(rst.message);
                            $this.remove();
                        } else {
                            jAlert(rst.message, '温馨提示')
                        }
                    })
                }
            });
            return false;
        })
    });
</script>
</body>
</html>
</#compress>